#ifndef __PAGELIBPREPROCESSOR_HPP_
#define __PAGELIBPREPROCESSOR_HPP_

#include <vector>
#include <unordered_map>
#include <map>

using std::map;
using std::vector;
using std::unordered_map;
using std::pair;
using std::string;

class PageLib;
class WebPage;
class PageLibPreprocessor
{
public:
    PageLibPreprocessor (std::vector<WebPage>& webpage) : _pageList(webpage){  }
    ~PageLibPreprocessor(){  }
    /* PageLibPreprocessor(Configuration & conf){} */
    void doProcess();

    void storeOnDisk();


private:
    void cutRedundantPages();
    void buildInvertIndexTable();//有问题！！

private:
    vector<WebPage>& _pageList;//网页库

    map<int,pair<int,int>>_offsetLib;//偏移库容器

    unordered_map<string,vector<pair<int,double>>> _invertIndexTable;
};

#endif
